DEVTOOLS = /Users/lgm/work/src/devtools

JAVAC = javac
JAVAC_FLAGS = -sourcepath . -cp $(DEVTOOLS)/java-cup-11a-runtime.jar:$(DEVTOOLS)/java-cup-11a.jar:$(DEVTOOLS)/JFlex/lib:$(DEVTOOLS)/jaxb/lib

JAVA = java
JAVA_FLAGS = -cp $(DEVTOOLS)/java-cup-11a-runtime.jar:$(DEVTOOLS)/java-cup-11a.jar:$(DEVTOOLS)/JLex.jar:$(DEVTOOLS)/JFlex/lib:$(DEVTOOLS)/jaxb/lib

CUP = java_cup.Main
CUPFLAGS = -nopositions -expect 100

JLEX = JLex.Main

LATEX = latex
DVIPS = dvips

all: test report.ps

test: absyn com/biosimilarity/example/report/Yylex.class com/biosimilarity/example/report/PrettyPrinter.class com/biosimilarity/example/report/Test.class com/biosimilarity/example/report/ComposVisitor.class com/biosimilarity/example/report/AbstractVisitor.class com/biosimilarity/example/report/FoldVisitor.class com/biosimilarity/example/report/AllVisitor.class com/biosimilarity/example/report/parser.class com/biosimilarity/example/report/sym.class com/biosimilarity/example/report/Test.class

.PHONY: absyn

%.class: %.java
	${JAVAC} ${JAVAC_FLAGS} $^

absyn: com/biosimilarity/example/report/Absyn/Report.java com/biosimilarity/example/report/Absyn/Application.java com/biosimilarity/example/report/Absyn/Dependency.java com/biosimilarity/example/report/Absyn/Aggregation.java com/biosimilarity/example/report/Absyn/Atomic.java com/biosimilarity/example/report/Absyn/Formals.java com/biosimilarity/example/report/Absyn/Parameters.java com/biosimilarity/example/report/Absyn/ReportId.java com/biosimilarity/example/report/Absyn/Variable.java com/biosimilarity/example/report/Absyn/Question.java com/biosimilarity/example/report/Absyn/Query.java com/biosimilarity/example/report/Absyn/ListReport.java com/biosimilarity/example/report/Absyn/ListReportId.java com/biosimilarity/example/report/Absyn/ListQuestion.java
	${JAVAC} ${JAVAC_FLAGS} $^

com/biosimilarity/example/report/Yylex.java: com/biosimilarity/example/report/Yylex
	${JAVA} ${JAVA_FLAGS} ${JLEX} com/biosimilarity/example/report/Yylex

com/biosimilarity/example/report/sym.java com/biosimilarity/example/report/parser.java: com/biosimilarity/example/report/report.cup
	${JAVA} ${JAVA_FLAGS} ${CUP} ${CUPFLAGS} com/biosimilarity/example/report/report.cup
	mv sym.java parser.java com/biosimilarity/example/report/

com/biosimilarity/example/report/Yylex.class: com/biosimilarity/example/report/Yylex.java com/biosimilarity/example/report/sym.java

com/biosimilarity/example/report/sym.class: com/biosimilarity/example/report/sym.java

com/biosimilarity/example/report/parser.class: com/biosimilarity/example/report/parser.java com/biosimilarity/example/report/sym.java

com/biosimilarity/example/report/PrettyPrinter.class: com/biosimilarity/example/report/PrettyPrinter.java

report.dvi: report.tex
	${LATEX} report.tex

report.ps: report.dvi
	${DVIPS} report.dvi -o report.ps

clean:
	 rm -f com/biosimilarity/example/report/Absyn/*.class com/biosimilarity/example/report/*.class
	 rm -f .dvi report.aux report.log report.ps  *.class

vclean:
	 rm -f com/biosimilarity/example/report/Absyn/Report.java com/biosimilarity/example/report/Absyn/Application.java com/biosimilarity/example/report/Absyn/Dependency.java com/biosimilarity/example/report/Absyn/Aggregation.java com/biosimilarity/example/report/Absyn/Atomic.java com/biosimilarity/example/report/Absyn/Formals.java com/biosimilarity/example/report/Absyn/Parameters.java com/biosimilarity/example/report/Absyn/ReportId.java com/biosimilarity/example/report/Absyn/Variable.java com/biosimilarity/example/report/Absyn/Question.java com/biosimilarity/example/report/Absyn/Query.java com/biosimilarity/example/report/Absyn/ListReport.java com/biosimilarity/example/report/Absyn/ListReportId.java com/biosimilarity/example/report/Absyn/ListQuestion.java com/biosimilarity/example/report/Absyn/Report.class com/biosimilarity/example/report/Absyn/Application.class com/biosimilarity/example/report/Absyn/Dependency.class com/biosimilarity/example/report/Absyn/Aggregation.class com/biosimilarity/example/report/Absyn/Atomic.class com/biosimilarity/example/report/Absyn/Formals.class com/biosimilarity/example/report/Absyn/Parameters.class com/biosimilarity/example/report/Absyn/ReportId.class com/biosimilarity/example/report/Absyn/Variable.class com/biosimilarity/example/report/Absyn/Question.class com/biosimilarity/example/report/Absyn/Query.class com/biosimilarity/example/report/Absyn/ListReport.class com/biosimilarity/example/report/Absyn/ListReportId.class com/biosimilarity/example/report/Absyn/ListQuestion.class
	 rm -f com/biosimilarity/example/report/Absyn/*.class
	 rmdir com/biosimilarity/example/report/Absyn/
	 rm -f report.tex report.dvi report.aux report.log report.ps 
	 rm -f com/biosimilarity/example/report/Yylex com/biosimilarity/example/report/report.cup com/biosimilarity/example/report/Yylex.java com/biosimilarity/example/report/VisitSkel.java com/biosimilarity/example/report/ComposVisitor.java com/biosimilarity/example/report/AbstractVisitor.java com/biosimilarity/example/report/FoldVisitor.java com/biosimilarity/example/report/AllVisitor.java com/biosimilarity/example/report/PrettyPrinter.java com/biosimilarity/example/report/Skeleton.java com/biosimilarity/example/report/Test.java com/biosimilarity/example/report/sym.java com/biosimilarity/example/report/parser.java com/biosimilarity/example/report/*.class
	 rm -f Makefile
	 rmdir -p com/biosimilarity/example/report/

